 <%@page import="java.sql.*,org.opencms.db.*,org.opencms.main.*"%>
 <% java.sql.Connection con = OpenCms.getSqlManager().getConnection("yourdb");
    Statement stmt = con.createStatement();
    ResultSet rs;
    rs = stmt.executeQuery("SELECT * FROM mail");
 
    while (rs.next()) {
 %> <%= rs.getString(1) %> <%= rs.getString(2) %><br><%
    }
 
    rs.close();
    stmt.close(); 
    con.close();
 %>